#ifndef PacketCodec_h__
#define PacketCodec_h__

#include "IObject/IPacketCodec.h"
#include "IObject/StdCmm.h"

class PacketCodec : public IPacketCodec
{
public:
	PacketCodec();
	virtual ~PacketCodec();

	virtual RawPacket*  PacketDecode(const void* buffer, uint32_t size);
	virtual SendBuffer* PacketEncode(const void* buffer, uint32_t size, CONTENT_TYPE type);

	virtual	void DeleteRawPacket(RawPacket * packet);
	virtual	void DeleteSendBuffer(SendBuffer * sendBuffer);
};


class HttpCodec :
	public IPacketCodec
{
public:
	HttpCodec();
	~HttpCodec();

	virtual RawPacket*  PacketDecode(const void* buffer, uint32_t size);
	virtual SendBuffer* PacketEncode(const void* buffer, uint32_t size, CONTENT_TYPE type);

	virtual	void DeleteRawPacket(RawPacket * packet);
	virtual	void DeleteSendBuffer(SendBuffer * packet);
};


#endif // PacketCodec_h__
